﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Notification.aspx.cs" Inherits="WebMMS.Manager.Notification" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript" src="../script/jquery.js"></script>
    <script type="text/javascript" src="../script/jquery.setBrowserClass.js"></script>
    <script type="text/javascript" src="../script/jquery.marquee.js"></script>
    <script type="text/javascript" src="../script/main.js"></script>
    <script type="text/javascript" src="../script/Common.js"></script>
    <script language="javascript" type="text/javascript" src="../script/UCcalendar/WdatePicker.js"></script>
    <script type="text/javascript">
        function CheckSave() {
            var strNO = $("#<%=txtTitle.ClientID%>").val().Trim();
            if (strNO == "") {
                alert("标题必须填写！");
                return false;
            }
            var strName = $("#<%=txtMsg.ClientID%>").val().Trim();
            if (strName == "") {
                alert("通知的消息必须填写！");
                return false;
            }
            return true;
        }
        function AddNew() {
            window.location.href = "NotificationAdd.aspx";
            return false;
        }
        function ToUrl() {
            window.location.href = "NotificationUrl.aspx";
            return false;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <form id="Form1" runat="server">
    <div align="center">
        <table>
            <tr>
                <td style="text-align: right;">
                    标题<span style="color: Red;">*</span>
                </td>
                <td style="text-align: left;">
                    <asp:TextBox ID="txtTitle" runat="server" CssClass="txtBoxNormal" MaxLength="200"></asp:TextBox>
                </td>
                <td style="text-align: right;">
                    通知的消息<span style="color: Red;">*</span>
                </td>
                <td style="text-align: left;">
                    <asp:TextBox ID="txtMsg" runat="server" CssClass="txtBoxNormal"></asp:TextBox>
                </td>
                <td>
                    &nbsp;&nbsp;
                    <asp:Button ID="btnQuery" runat="server" Text="查 询" CssClass="button_green" Width="70px"
                        OnClick="btnQuery_Click" />
                </td>
            </tr>
        </table>
        <br />
        <div style="width: 100%; text-align: left;">
            <asp:Button ID="btnUp" Text="添加新通知" runat="server" OnClientClick="return AddNew();"
                CssClass="button_blue" />
            &nbsp;&nbsp;
            <asp:Button ID="btnToUrl" Text="通知url管理" runat="server" OnClientClick="return ToUrl();"
                CssClass="button_blue" />
        </div>
        <asp:GridView ID="GVinfo" runat="server" AutoGenerateColumns="False" CssClass="reason_box"
            Font-Size="12px" CellPadding="0" BorderWidth="0px" BorderColor="#A6E1FF" Width="100%"
            OnRowCancelingEdit="GVinfo_RowCancelingEdit" OnRowDeleting="GVinfo_RowDeleting"
            OnRowDataBound="GVinfo_RowDataBound" OnRowEditing="GVinfo_RowEditing" OnRowUpdating="GVinfo_RowUpdating"
            AllowPaging="True" PageSize="15">
            <Columns>
                <asp:TemplateField HeaderText="ID">
                    <ItemTemplate>
                        <asp:Label ID="lbNO" runat="server" Text='<%# Bind("ID") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="标题">
                    <EditItemTemplate>
                        <asp:TextBox ID="txtTitle" runat="server" Text='<%# Bind("Title") %>' MaxLength="200"
                            CssClass="txtInfo"></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lbTitle" runat="server" Text='<%# Bind("Title") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="通知的消息">
                    <EditItemTemplate>
                        <asp:TextBox ID="txtMsg" runat="server" Text='<%# Bind("Msg") %>' TextMode="MultiLine"
                            CssClass="txtBoxNormal" Height="40px" Width="220px"></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lbMsg" runat="server" Text='<%# Bind("Msg") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="打开的URL">
                    <ItemTemplate>
                        <asp:Label ID="lbUrl" runat="server" Text='<%# Bind("UrlID") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="创建时间">
                    <ItemTemplate>
                        <asp:Label ID="lbCreateTime" runat="server" Text='<%# Bind("CreateTime") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="管理" ItemStyle-Wrap="false">
                    <EditItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                            Text="更新"></asp:LinkButton>
                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                            Text="取消"></asp:LinkButton><asp:HiddenField ID="HF1" runat="server" Value='<%#Eval("ID") %>' />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                            Text="编辑"></asp:LinkButton>
                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete"
                            Text="删除" OnClientClick="return confirm('确定要删除？')"></asp:LinkButton><asp:HiddenField
                                ID="HF2" runat="server" Value='<%#Eval("ID") %>' />
                    </ItemTemplate>
                    <HeaderStyle BorderColor="#4DA6FF" BorderWidth="1px" />
                    <ItemStyle BorderColor="#4DA6FF" BorderWidth="1px" Width="80px" />
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <span style="color: Red; font-weight: bold;">没有数据！</span>
            </EmptyDataTemplate>
        </asp:GridView>
        <div style="padding-top: 10px; text-align: right;">
            <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_PageChanged"
                PageSize="30" FirstPageText="首页" LastPageText="末页" NextPageText="下一页" PrevPageText="上一页"
                ShowBoxThreshold="999">
            </webdiyer:AspNetPager>
        </div>
    </div>
    </form>
</asp:Content>
